<template>
  <base-breadcrumb>
    <a-card :bordered="false">
      <title-name title="分包商技术答辩信息" />

      <a-row :gutter="24">
                <a-col
                  :md="16"
                  :sm="16"
                >
                  <a-form-item
                    label="所属单位"
                    :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                    :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                  >
<!--                    <BaseInput-->
<!--                      v-model="dels.projectName"-->
<!--                      disabled-->
<!--                    />-->
                    <org-tree-select
                      disabled
                      is-need-auth
                      :value="dels.projectId"></org-tree-select>
                  </a-form-item>
                </a-col>
<!--        <a-col-->
<!--          :md="8"-->
<!--          :sm="8"-->
<!--        >-->
<!--          <a-form-item-->
<!--            label="分公司"-->
<!--            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"-->
<!--            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"-->
<!--          >-->
<!--            <BaseInput-->
<!--              v-model="dels.branchCompanyName"-->
<!--              disabled-->
<!--            />-->
<!--          </a-form-item>-->
<!--        </a-col>-->
<!--        <a-col-->
<!--          :md="8"-->
<!--          :sm="8"-->
<!--        >-->
<!--          <a-form-item-->
<!--            label="项目名称"-->
<!--            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"-->
<!--            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"-->
<!--          >-->
<!--            <BaseInput-->
<!--              v-model="dels.projectName"-->
<!--              disabled-->
<!--            />-->
<!--          </a-form-item>-->
<!--        </a-col>-->
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="项目编号"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.projectNum"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="答辩时间"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.replyDate"
              disabled
            />
          </a-form-item>
        </a-col>
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="招标内容"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.biddingContent"
              disabled
            />
          </a-form-item>
        </a-col>
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="计划选择分包商个数"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.planSubSize"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :md="24"
          :sm="24"
        >
          <a-form-item
            label="招标内容备注"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseTextarea
              v-model="dels.biddingContentRemark"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :md="24"
          :sm="24"
        >
          <a-form-model-item
            label="招标详细情况"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
            prop="biddingDetails"
          >
            <BaseTextarea
              v-model="dels.biddingDetails"
              type="textarea"
              disabled
            />
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :md="24"
          :sm="24"
        >
          <a-form-item
            label="备注信息"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseTextarea
              v-model="dels.remark"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="创建人"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.creatorName"
              disabled
            />
          </a-form-item>
        </a-col><a-col
          :md="8"
          :sm="8"
        >
          <a-form-item
            label="创建时间"
            :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
            :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
          >
            <BaseInput
              v-model="dels.creatorDate"
              disabled
            />
          </a-form-item>
        </a-col>
      </a-row>
    </a-card>

    <a-card style="margin-top: 20px">
      <title-name title="招标单位信息" />

      <a-table
        bordered
        :pagination="false"
        :columns="columnInfos"
        :data-source="data"
      >
        <span
          slot="serial"
          slot-scope="text, record, index"
        >{{ index + 1 }}</span>
        <span
          slot="remark"
          slot-scope="text, record, index"
        >
          <ellipsis
            :length="20"
            tooltip
          >{{ text }}</ellipsis>
        </span>
      </a-table>

      <title-name
        title="招标单位附件信息"
        style="margin-top: 20px"
      />
      <u-table
        :upload-arrys="dataAssment"
        business-code="PM19"
        @fileArrysData="dataAssment"
      />
      <!-- <a-table
        bordered
        :pagination="false"
        :columns="columns"
        :data-source="dataAssment"
      >
        <span
          slot="serial"
          slot-scope="text, record, index"
        >{{ index + 1 }}</span>
        <span
          slot="action"
          slot-scope="text, record, index"
        >
          <a
            :href="'/api/ycloud-file-center/oper/download?access_token='+token+'&fileId='+record.fileId"
            target="_parent"
          >导出</a>
        </span>
      </a-table> -->
    </a-card>

    <div class="page-btn-right-top">
      <a-button
        type="primary"
        @click="goBack"
      >
        关闭
      </a-button>
    </div>
  </base-breadcrumb>
</template>

<script>
import Vue from 'vue'
import { STable, Ellipsis } from '@/components'
import { getdefenceRecordOne, getReplyBidderList } from '@/api/subcontractors/defenceRecord'

import ARow from 'ant-design-vue/es/grid/Row'

const columnInfos = [
    {
        title: '序号',
        scopedSlots: { customRender: 'serial' }
    },
    {
        title: '投标单位名称',
        dataIndex: 'name'
    },
    {
        title: '分包商来源',
        dataIndex: 'isQualified'
    },
    {
        title: '答辩人',
        dataIndex: 'replier'
    },
    {
        title: '联系方式',
        dataIndex: 'contactInfo'
    },
    {
        title: '是否提交答辩资料',
        dataIndex: 'isSubmitFilesName'
    },
    {
        title: '答辩通过情况',
        dataIndex: 'isPastName'
    },
    // {
    //   title: '答辩工程类别',
    //   dataIndex: ''
    // },
    {
        title: '答辩评分',
        dataIndex: 'replyScore'
    },
    {
        title: '备注信息',
        dataIndex: 'remark',
        scopedSlots: { customRender: 'remark' }
    }
]

const columns = [
    {
        title: '序号',
        dataIndex: 'serial',
        width: '5%',
        scopedSlots: { customRender: 'serial' }
    },
    {
        title: '附件名称',
        dataIndex: 'fileName',
        width: '35%'
    },
    {
        title: '附件格式',
        dataIndex: 'suffixName',
        width: '35%'
    },
    {
        title: '操作',
        key: 'action',
        width: '20%',
        scopedSlots: { customRender: 'action' }
    }
]
export default {
    name: 'a' + Date.now(),
    components: {
        ARow,
        Ellipsis
    },
    data() {
        this.columns = columns
        return {
            columnInfos,
            data: [],
            dataAssment: [],
            totalDels: {},
            queryParams: {
                pageNo: 1,
                pageSize: 10
            },
            dels: {},
            replyId: '',
            token: ''
        }
    },

    created() {
        this.replyId = this.$route.query.replyId
        this.queryParams.replyId = this.$route.query.replyId
        this.token = Vue.getAcloudProvider().getAccessToken()
        this.getdefenceRecordOne()
        this.getReplyBidderList()
    },
    computed: {},
    methods: {
        goBack() {
            this.$multiTab.close(this.$route.fullpath)
        },
        getdefenceRecordOne() {
            getdefenceRecordOne({ id: this.replyId }).then((res) => {
                this.dels = res.data
                this.dataAssment = res.data.fileList
            })
        },

        getReplyBidderList() {
            this.queryParams.replyId = this.replyId
            getReplyBidderList(this.queryParams).then((res) => {
                this.data = res.data
            })
        }
    }
}
</script>


